package financial.sharing.center.invoice.model.entity;

import financial.sharing.center.common.base.BaseEntity;
import financial.sharing.center.common.enums.EnableStatusEnum;
import financial.sharing.center.common.enums.InvoiceOperationStageEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.ToString;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @ClassName Invoice
 * @Description TODO
 * @Author guoyuhang
 * @ @csdn https://blog.csdn.net/qq_40788718
 * @Date 2021/4/12
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@ToString
@Entity
public class Invoice extends BaseEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    /**业务线id*/
    private Integer businessLineId;
    @Transient
    private String businessLineName;
    /**合同id*/
    private Integer contractId;
    @Transient
    private String contractName;
    /**发票颜色*/
    private Integer invoiceColorValue;
    @Transient
    private String invoiceColorName;
    /**发票类型*/
    private Integer invoiceTypeValue;
    @Transient
    private String invoiceTypeName;
    /**发票内容*/
    private String invoiceContext;
    /**可用性*/
    private Integer enableStatusValue;
    /**发票操作阶段*/
    private Integer invoiceOperationStageValue;
    @Transient
    private String invoiceOperationStageName;

    @Transient
    private InvoiceDetail invoiceDetail;

    public Invoice() {

    }

    public Invoice(String invoiceContext, Integer invoiceTypeValue, Integer invoiceColorValue) {
        this.invoiceContext = invoiceContext;
        this.invoiceColorValue = invoiceColorValue;
        this.invoiceTypeValue = invoiceTypeValue;
        this.invoiceOperationStageValue = InvoiceOperationStageEnum.待编辑.getValue();
        this.enableStatusValue = EnableStatusEnum.正常.getValue();
    }
}
